package com.quartz.jobTask;

import com.quartz.config.JobConstant;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobKey;

/**
 * @author
 */
public abstract class JobDetailInstantiation implements JobInstantiation {

    public JobDetail createJobDetail(MessageInfo messageInfo){
        return JobBuilder.newJob(messageInfo.getCustomJob().getClass())
                .withIdentity(new JobKey(messageInfo.getApplicationCode() + "_" + messageInfo.getTaskId() +"_"+ JobConstant.JOB
                        , messageInfo.getApplicationCode()))
                .usingJobData(messageInfo.getJobDataMap()).build();
    }


}
